#include<bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
	int n;
	cin >> n;
	int a[n + 10];
	int b[n + 10];
	for(int i = 1; i <= n; i ++ ) {
		cin >> a[i];
	}
	for(int j = 1; j <= n; j ++ ) {
		cin >> b[j];
	}
	sort(a + 1, a + n + 1);
	sort(b + 1, b + n + 1);
	cout << b[n] + a[n] << endl;
	return 0;
}

